Vue.component('mydiv', {
    template:
        `
        <div>
            <ul>
                <li v-for="name in arr" @click="show(name)">{{name}}</li>
            </ul>
        </div>
    `,
    data: function () {
        return{
            arr: ["刘备", "关羽", "张飞"]
        }
    },
    methods: {
        show: function (name) {
            alert(name);
        }
    }
})

let v = new Vue({
    el: "mydiv",
})